<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.maoye.ossp.sys.org.util.UserUtils" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="currentUserName" value="<%=UserUtils.getCurrentUserName()%>"/>
<!DOCTYPE html >
<html> 
     <head> 
       <meta name="decorator" content="sysDefault"/>
       <title>茂业运营服务支撑平台</title> 
		<link type="text/css" rel="stylesheet" href="${staticPath}/lib/jquery-jbox/2.3/Skins2/Blue/jbox.css" />
		<script src="${staticPath}/lib/jquery-jbox/2.3/jquery-1.4.2.min.js" type="text/javascript"></script>
		<script src="${staticPath}/lib/jquery-jbox/2.3/jquery.jBox-2.3.min.js" type="text/javascript"></script>
		<script src="${staticPath}/lib/jquery-jbox/2.3/i18n/jquery.jBox-zh-CN.min.js" type="text/javascript"></script>
       <script type="text/javascript">
     		$(document).ready(function() {
     			
     			$("#openClose").click(function(){
     				if(!$("#openClose").hasClass("close")){
     					$("#rightFrame").attr("class","col-sm-10");
 					}
     				$(this).toggleClass("close");
     				$("#leftFrame").toggle(400,function(){
     					if(!$("#openClose").hasClass("close")){
         					$("#rightFrame").attr("class","col-sm-12");
     					}
     				});
     			});
     			$("#bs-navbar-collapse>ul>li").click(function(){
     				var $li = $(this);
     				if($li.hasClass("dropdown")){
         				$("#bs-navbar-collapse li").removeClass("active");
        				$(this).addClass("active");
        				if(!$("#openClose").hasClass("close")){
        					$("#openClose").click();
        				}
     				}
    			});
    			$('[data-p-id]').each(function (){
    				$("#"+$(this).attr("data-p-id")).addClass("active");
    			});
     		});
     		
   		function getUrl(url,target){
   			window.open(url,target);
   			if(target!='mainFrame'){
   			 $("#mainFrame").attr("src",'sys/home');
   			 
   			}
   		}
       </script>
     </head> 
     <body> 
		<header class="navbar navbar-default navbar-fixed-top o-nav-header" role="navigation">
		  <div class="navbar-header">
		    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse">
		      <span class="sr-only">Toggle navigation</span>
		      <span class="icon-bar"></span>
		      <span class="icon-bar"></span>
		      <span class="icon-bar"></span>
		    </button>
		    <a class="navbar-brand" href="${contextPath}/index"><img alt="" src="${staticPath}/images/logo4.png"></a>
		  </div>
		  <div class="collapse navbar-collapse" id="bs-navbar-collapse">
		    <ul class="nav navbar-nav">
			    <c:forEach items='${ossp:getNavListBySiteCode("sys")}' var="nav">
					<c:choose>
						<c:when test="${nav.isDropdown==1}">
							<li class="dropdown" id="${nav.id}"><a href="#" class="dropdown-toggle"
								data-toggle="dropdown">${nav.name}<b class="caret"></b></a>
								<ul class="dropdown-menu">
									<c:forEach items='${nav.chidren}' var="chidren">
										<li <c:if test="${chidren.id  == navId}">class="active" data-p-id="${nav.id}"</c:if>><a href="${contextPath}/${chidren.id}-index.html"
											target="${chidren.target}">${chidren.name}</a></li>
									</c:forEach>
								</ul></li>
						</c:when>
						<c:otherwise>
							<li <c:if test="${nav.id  == navId}">class="active"</c:if>><a href="${contextPath}/${nav.id}-index.html"
								target="${nav.target}">${nav.name}</a></li>
						</c:otherwise>
					</c:choose>
				</c:forEach>
		    </ul>
		    <ul class="nav navbar-nav navbar-right">
			      <li class="dropdown">
			        <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="padding-bottom: 10px;padding-top: 10px;">
			        	<img src="${staticPath}/images/user/avatar.png" width="30" height="30" alt="${currentUserName}" class="img-rounded">
			        	${currentUserName}<b class="caret"></b>
			        </a>
			        <ul class="dropdown-menu">
			          <li><a href="#" data-toggle="modal" data-target="#updatePwdModal">修改密码</a></li>
			          <li class="divider"></li>
			          <li><a href="<c:url value="/logout"/>">退出</a></li>
			        </ul>
			      </li>
		     </ul>
		  </div>
		</header>
		<div class="container-fluid" id="wrapper">
			<div class="row">
				<div id="leftFrame" class="col-sm-2">
					<iframe id="menuFrame" name="menuFrame" src="sys/sitenavmenu/showSysMenu?navId=${navId}" style="overflow:visible;"
						scrolling="no" frameborder="no" width="100%" height="750"></iframe>
				</div>
				<div id="rightFrame" class="col-sm-10">
					<div id="openClose" class="close">&nbsp;</div>
					<iframe id="mainFrame" name="mainFrame" src="sys/home" style="overflow:visible;"
						scrolling="yes" frameborder="no" width="100%" height="750"></iframe>
				</div>
			</div>
		</div>
		<%@ include file="/WEB-INF/views/include/changePwd.jsp"%>
     </body> 
</html> 